﻿using System;
using UnityEngine;

namespace Yoozoo.Core.Common
{
    /// <summary>
    /// 根据当前质量等级，开关游戏物件
    /// </summary>
    public class GameObjectActiveQualityListener : QualityListenerMono<GameObjectActiveQualityListener.GameObjectActiveSetting>
    {
        public GameObject GameObject;

        [Serializable]
        public class GameObjectActiveSetting : QualitySetting
        {
            public bool IsActive;
        }

        public override void ChangeQualitySetting(GameObjectActiveSetting qualitySetting)
        {
            if (GameObject == null)
                return;

            GameObject.SetActive(qualitySetting.IsActive);
        }
    }
}